<?php
require_once '../ptnhuan-web1/libraries/utilites/functions.php';
$file_name = "../ptnhuan-web1/data/films.txt";
     $file_path = realpath($file_name);
     $films = mreadFile($file_name);
     $films = array();
     $file = fopen($file_path, "r");
     //var_dump ($file);
     //$data= fgets($file);
     while(!feof($file)){
        
         $films[] = trim(fgets($file));
         //var_dump ($films);
     }
         fclose($file);
?>
<?php foreach ($films as $line):?>
<?php if(!empty($line)):?>
<?php $film= explode(";", $line);?>
<?php //$img = trim($film[0]);?>
<?php //$rating = inval($films[3]);?>

<img src='../ptnhuan-web1/public/images/films/<?php     echo $film[1] ?>'>
<?php     echo $film[2] ?><br>
<?php endif; ?>
<?php endforeach;?>



